<?php
/**
 * 评论模板
 */
if (post_password_required()) {
    return;
}
?>

<div id="comments" class="comments-area">
    <?php if (have_comments()) : ?>
        <h3 class="comments-title">
            <?php
            printf(
                _nx('1 条评论', '%1$s 条评论', get_comments_number(), '评论标题', 'my-simple-theme'),
                number_format_i18n(get_comments_number())
            );
            ?>
        </h3>

        <?php if (get_comment_pages_count() > 1 && get_option('page_comments')) : ?>
        <nav class="comment-navigation">
            <?php paginate_comments_links(); ?>
        </nav>
        <?php endif; ?>

        <ol class="comment-list">
            <?php
            wp_list_comments(array(
                'style'      => 'ol',
                'short_ping' => true,
                'avatar_size'=> 56,
                'callback'   => 'custom_comment_display'
            ));
            ?>
        </ol>

        <?php if (get_comment_pages_count() > 1 && get_option('page_comments')) : ?>
        <nav class="comment-navigation">
            <?php paginate_comments_links(); ?>
        </nav>
        <?php endif; ?>

    <?php else : ?>
        <p class="no-comments">暂无评论，快来抢沙发吧~</p>
    <?php endif; ?>

    <div class="comment-form-container">
        <?php 
        comment_form(array(
            'title_reply' => '发表评论',
            'comment_notes_before' => '<p class="comment-notes">您的邮箱不会被公开显示</p>',
            'label_submit' => '提交评论',
            'class_submit' => 'comment-submit-btn'
        )); 
        ?>
    </div>
</div>
